#include "canbus/rm_udp_canbus.hpp"
uint8_t f = 0;
void callback(uint32_t id, uint8_t dlc, uint8_t *data)
{

    while (f)
    {
        sleep_ms(1);
    }
    f = 1;
    printf("tt id=%X[ ", id);
    for (size_t i = 0; i < dlc; i++)
    {
        printf("%x ", data[i]);
    }
    printf("]\n");
    f = 0;
}

int main(int argc, char **argv)
{

    // setlocale(LC_ALL, "zh_CN.UTF-8");
    // ros::start();
    UDP_CAN can1, can2;
    can1.canCallBackprt = callback;
    can2.canCallBackprt = callback;
    can1.Init_CAN(8881);
    can2.Init_CAN(8882);

    while (1)
    {
       
        sleep_ms(1);
    }

    return 0;
}